package org.example.computerdesign.controller;

import org.example.computerdesign.common.RespBody;
import org.example.computerdesign.common.SendEmail;
import org.example.computerdesign.domain.dto.CodeBody;
import org.example.computerdesign.service.CommonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
/**
 * @author 朱文权
 * */
@RestController
public class CommonController {
    @Autowired
    private CommonService commonService;
    @PostMapping("sendCode")
    public RespBody<?> sendCode(@RequestBody @Validated CodeBody codeBody){
        commonService.sendCode(codeBody.getEmail());
        return RespBody.success();
    }

}
